% Create a table row counter
\newcounter{reqnum}
\setcounter{reqnum}{0}

% Commands for row numbering
\newcommand{\rn}[1]{\addtocounter{reqnum}{1} \arabic{section}.\arabic{subsection}.\arabic{reqnum} \label{#1}}
\newcommand{\rc}{\setcounter{reqnum}{0}}
% Colors
\definecolor{red}{rgb}{0.8,0,0}
\definecolor{green}{rgb}{0,0.8,0}
\definecolor{blue}{rgb}{0,0,0.8}
% Commands for functionality types
\newcommand{\fe}{\textcolor{red}{Essential}}
\newcommand{\fd}{\textcolor{blue}{Desirable}}
\newcommand{\fo}{\textcolor{green}{Optional}}

\section{Requirements}
\label{sec:req}

	\subsection{Sound}
	\label{sec:sound}
		\rc
		\begin{tabular}{|l|l|c|}
			\hline
			\textbf{Number} & \textbf{Functionality} & \textbf{Type} \\ \hline \hline
			\rn{snd:mixer} & Multiple simultaneous sounds & \fe \\ \hline
			\rn{snd:music} & Background music & \fe \\ \hline
			\rn{snd:ambient} & Localized ambient sounds & \fe \\ \hline
			\rn{snd:atten} & Sound attenuation over distance & \fe \\ \hline
			\rn{snd:trigger} & Triggered sounds & \fe \\ \hline
		\end{tabular}

	% Pathfinding must be fast
	\subsection{Artificial intelligence (AI)}
	\label{req:AI}
		\rc
		\begin{tabular}{|l|l|c|}
			\hline
			\textbf{Number} & \textbf{Functionality} & \textbf{Type} \\ \hline \hline
			\rn{ai:visibility} & Checking if a block is in the view of an NPC or entity & \fe \\ \hline
			\rn{ai:pathfinding} & Pathfinding from one block to another & \fe \\ \hline
			\rn{ai:traversal} & Fast traversal from a block to its neighbors & \fe \\ \hline
		\end{tabular}
